package me.zhengjie.modules.security.security;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.config.annotation.SecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.web.DefaultSecurityFilterChain;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.stereotype.Component;

/**
 * Description: SecurityConfigurerAdapter .<br>
 *
 * @author jm
 * @since 2020/1/20
 */
@Component
public class TokenConfigurer extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity> {
    @Autowired private TokenFilter customFilter;

    @Override
    public void configure(HttpSecurity http) {
        http.addFilterBefore(customFilter, UsernamePasswordAuthenticationFilter.class);
    }
}
